package com.guan.ioc.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/prop")
public class PropertiesController {

    @Value("${my.key}")
    private String myKey;

    @Value("${my.key1}")
    private Integer myKey1;

    @Value("${my.key2}")
    private boolean  myKey2;

    @Value("${spring.datasource.url}")
    private String url;

    @RequestMapping("/readValue")
    public String readValue() {
        System.out.println("myket: " + myKey);
        System.out.println("myket1: " + myKey1);
        System.out.println("myket2: " + myKey2);
        System.out.println("url: " + url);
        return "myket: " + myKey;
    }
}
